<template>
	<div class="p_20">
		<!-- <el-page-header @back="goBack" content="编辑"></el-page-header> -->
		<el-dialog :visible="isShow" @close="closeDialog" :close-on-click-modal="false">
			<el-divider></el-divider>
			<el-form label-width="120px">
				<el-form-item label="权限名">
					<el-input v-model.trim="roleTree.name" size="small"></el-input>
				</el-form-item>
				<el-form-item label="备注" v-if="roleTree.id">
					<el-input v-model.trim="roleTree.remark" size="small"></el-input>
				</el-form-item>
				<!-- <el-form-item label="密码">
            <el-input v-model.trim="form.password" size="small" placeholder="不填写默认为不修改密码"></el-input>
          </el-form-item> -->

				<el-form-item label="">
					<!-- <el-switch
              v-model="form.state"
              active-value="1"
              inactive-value="0"
              active-color="#13ce66"
              inactive-color="#ff4949"
            ></el-switch> -->


					<div class="p_20" v-if="roleTree.id">

						<el-tree class="filter-tree" :data="data1" :props="defaultProps" node-key="id" show-checkbox @check="handleCheckChange" ref="tree">
						</el-tree>
					</div>
				</el-form-item>
				<el-form-item>
					<el-button size="small" type="primary" @click="submit">提交</el-button>
					<el-button size="small" @click="closeDialog">取消</el-button>
				</el-form-item>
			</el-form>
		</el-dialog>
	</div>
</template>

<script>
	import methods from "./method";
	import data from "./data";
	// import E from "wangeditor";

	export default {
		data() {
			return data.init();
		},
		methods: methods,
		mounted() {
			// this.getSelect();
			//获取人力资源id
			// console.log(this.$route.params == {});
			let arr = Object.keys(this.$route.params)
			if (arr.length > 0) {
				this.id = this.$route.params.info.id;
				this.form = this.$route.params.info;
				this.form.state = this.form.state.toString();
			} 
		}
	};
</script>

<style>
	.avatar-uploader .el-upload {
		border: 1px dashed #d9d9d9;
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
	}

	.avatar-uploader .el-upload:hover {
		border-color: #409eff;
	}

	.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		line-height: 178px;
		text-align: center;
	}

	.avatar {
		width: 178px;
		height: 178px;
		display: block;
	}
</style>
